#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */

unsigned char temp1,temp3;
volatile unsigned char dato5;
unsigned int **stack_pointer;
unsigned int *pc_actual;

unsigned char dummy_function (unsigned char temp,volatile unsigned char dato5) {
#asm     
nop
ais #1
tsx
ais #-1
sthx stack_pointer
#endasm;
//stack_pointer++;
pc_actual=*stack_pointer;
#asm
ldhx  pc_actual
JMP ,X
#endasm;


return temp++;  
}


void main (void) {
unsigned char temp2;

temp1=5;
dato5=14;
temp3=dummy_function(temp1,dato5);

EnableInterrupts;
    
    
//MCGTRM=NVMCGTRM;
TPM2SC=0b00001011;  // bus clock, inter deshab, preesc=8;
TPM2C3SC=0b01010100; // hab inter, output compare toggle
while (1);
  
}